package com.gvjn.ant.customtasks.commons;

import java.util.ArrayList;
import java.util.StringTokenizer;

public class Parser {
	    public static ArrayList<String> parseMyList (String myList){
	   		ArrayList<String> separatedList = new ArrayList<String>();
	   		if (myList == null){
	   			separatedList.add("");
	   			return separatedList;
	   		}
	   		StringTokenizer parser;
	  		final String deLim = ",";
	   		parser = new StringTokenizer (myList, deLim);
	   		while (parser.hasMoreTokens ()){
	   			separatedList.add(parser.nextToken ());
	   		}
	    	return separatedList;
	  	}

	    public static ArrayList<String> parseMyListWithDelim (String myList, String deLim){
	   		ArrayList<String> separatedList = new ArrayList<String>();
	   		if (myList == null){
	   			separatedList.add("");
	   			return separatedList;
	   		}
	   		StringTokenizer parser;
	   		parser = new StringTokenizer (myList, deLim);
	   		while (parser.hasMoreTokens ()){
	   			separatedList.add(parser.nextToken ());
	   		}
	    	return separatedList;
	  	}
}